package com.wtw.controller;

import com.wtw.entity.User;
import com.wtw.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * <strong>Title : <br></strong>
 * <strong>Package : <br></strong>
 * <strong>Description : </strong><br>
 * <strong>Create on : 2018/6/3<br></strong>
 * <p>
 *
 * @author tengwei.wang<br>
 * @version <strong>v1.0.0</strong><br>
 *          <br>
 *          <strong>修改历史:</strong><br>
 *          修改人 | 修改日期 | 修改描述<br>
 *          -------------------------------------------<br>
 *          <br>
 *          <br>
 */

@Controller
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("/dd")
    public ModelAndView selectUserById(){
        ModelAndView mv = new ModelAndView("index");
        User user = userService.selectUserById(1);
        mv.addObject(user);
        return mv;
    }
}
